<template>
    <table>
        <tr>
            <td>门店名称</td>
            <td>门店地址</td>
            <td>门店图片</td>
            <td>备注</td>
            <td>门店状态</td>
        </tr>
        <tr v-for="item in list">
            <td>{{item.sname}}</td>
            <td>{{item.address}}</td>
            <td><img :src="item.picture" width="50" height="50"></td>
            <td>{{ item.remark }}</td>
            <td>{{item.states==1?"开店":"关门"}}</td>
        </tr>
    </table>
  </template>
  
  <script setup lang="ts">
  import{onMounted, reactive, toRefs} from 'vue'
  import axios from 'axios'
  import {useRouter,useRoute} from 'vue-router'
  const route=useRoute()
  const router=useRouter()

  let data=reactive({
    list:[]
  })
  let{list} =toRefs(data)

  onMounted(()=>{
    showlist()
  })

  const showlist=()=>{
    axios({
        url:'/api/Store/GetStores',
        method:'get'
    })
    .then(res=>{
        console.log(res)
        list.value=res.data.data;
        console.log(list.value)
    })
    .catch(err=>{
        console.log(err)
    })
  }
  </script>
  
  <style scoped>
  
  </style>